package com.mt.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mt.pojo.FilmComment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Wang
 * @since 2020-11-18
 */
@Mapper
public interface FilmCommentMapper extends BaseMapper<FilmComment> {

    FilmComment getUserComments(@Param("userId") String userId, @Param("filmId") int filmId);

    List<FilmComment> listCommentByFilmId(@Param("page") IPage<FilmComment> page,
                                          @Param("filmId") Integer filmId,
                                          @Param("userId") String userId,
                                          @Param("listType") Integer listType);

    List<FilmComment> getHotCommentByFilmId(@Param("page") IPage<FilmComment> page, @Param("filmId") Integer filmId);

    List<FilmComment> getNewCommentByFilmId(@Param("page") IPage<FilmComment> page, @Param("filmId") Integer filmId);

    boolean batchUpdateCommentLikeNum(@Param("likeMap") Map<Integer, Integer> likeMap);
}
